package com.company.test24;


/**
 * Created by Administrator on 2016.10.20.
 */
public class BucketSort {
    public static void bucketSort(int[] list){
        int[] bucket=new int[100000000];

        for(int i=0;i<list.length;i++){
            bucket[list[i]]++;
        }

        for(int i=0,sum=0,j=0;i<bucket.length;i++){
            sum=sum+bucket[i];
            while (j<sum){
                list[j++]=i;
            }
        }
    }
}
